import request from '@/utils/request'

//图片上传
export function upload(query) {
  return request({
    url: '/common/upload',
    method: 'post',
    data: data
  })
}
//客户查重
export function customerIsExist(id) {
  return request({
    url: '/customer/customerIsExist/'+id,
    method: 'get'
  })
}
//查询我的客户列表
export function customerList(query) {
  return request({
    url: '/customer/list',
    method: 'get',
    params: query
  })
}
//客户详情
export function getCustomerDetail(id) {
  return request({
    url: '/customer/detailsInfo/'+id,
    method: 'get'
  })
}
//编辑客户
export function editCustomer(query) {
  return request({
    url: '/customer',
    method: 'put',
    data: query
  })
}
//全部产品
export function productListAll(query) {
  return request({
    url: '/product/listAll',
    method: 'get',
    params: query
  })
}
// 查询重点客户列表
export function favoriteCustomerList(query) {
  return request({
    url: '/customer/favoriteCustomerList',
    method: 'get',
    params: query
  })
}
// 添加客户
export function customerAdd(data) {
  return request({
    url: '/customer',
    method: 'post',
    data: data
  })
}
// 作物列表
export function cropVariety(query) {
  return request({
    url: '/crop_variety/list',
    method: 'get',
    params: query
  })
}
///
export function cropListData() {
  return request({
    url: '/crop_variety/listData',
    method: 'get'
  })
}
// 查询无效客户列表
export function invalidList(query) {
  return request({
    url: '/customer/invalidList',
    method: 'get',
    params: query
  })
}

// 获取自己和下级用户
export function listData(query) {
  return request({
    url: '/system/user/listData',
    method: 'get',
    params: query
  })
}

// 客户管理-转移客户
export function transferCustomer(query) {
  return request({
    url: '/customer/transferCustomer',
    method: 'put',
    params: query
  })
}
//转移客户
export function invalidTransferCustomer(query) {
  return request({
    url: '/customer/invalidTransferCustomer',
    method: 'put',
    params: query
  })
}
// 移入公海
export function transferHighSeas(data) {
  return request({
    url: '/customer/transferHighSeas/',
    method: 'put',
    data: data
  })
}
//置顶客户
export function editTopUp(id) {
  return request({
    url: '/customer/editTopUp/'+id,
    method: 'put',
  })
}
//取消置顶客户
export function editUnTopUp(id) {
  return request({
    url: '/customer/cancelTopUp/'+id,
    method: 'put',
  })
}
//查询客户详情
export function customerDetail(id) {
  return request({
    url: '/customer/detailedInforMtion/'+id,
    method: 'get',
  })
}
//360概况
export function overViewInfo(id) {
  return request({
    url: '/customer/overViewInfo/'+id,
    method: 'get',
  })
}
//设置为无效客户
export function invalidCustomer(id) {
  return request({
    url: '/customer/invalidCustomer/'+id,
    method: 'put',
  })
}
//重点关注
export function favorite(id) {
  return request({
    url: '/customer/favorite/'+id,
    method: 'put',
  })
}
//取消重点关注
export function cancelFavorite(id) {
  return request({
    url: '/customer/cancelFavorite/'+id,
    method: 'put',
  })
}
// 360概况动态
export function customerDynamicList(query) {
  return request({
    url: '/customer/customerDynamicList',
    method: 'get',
	params: query
  })
}
//详情
export function detailedInforMtion(id) {
  return request({
    url: '/customer/detailedInforMtion/'+id,
    method: 'get',
  })
}
//跟进记录
export function recordList(query) {
  return request({
    url: '/followup_record/recordList',
    method: 'get',
	params: query
  })
}
//客户360订单分析-产品订单统计/
export function orderAnalysisProduct(query) {
  return request({
    url: 'customer/orderAnalysisProduct',
    method: 'get',
	params: query
  })
}
// 客户360订单分析-月
export function orderAnalysisMonth(query) {
  return request({
    url: '/customer/orderAnalysisMonth',
    method: 'get',
	params: query
  })
}
//订单记录
export function orderRecord(query) {
  return request({
    url: '/customer/orderRecord',
    method: 'get',
	params: query
  })
}
//作物结构
export function cropStructure(id) {
  return request({
    url: '/customer/cropStructure/'+id,
    method: 'get',
  })
}
//销售规模
export function saleScale(id) {
  return request({
    url: '/customer/saleScale/'+id,
    method: 'get',
  })
}
//归属记录
export function belongToRecord(id,query) {
  return request({
    url: '/customer/belongToRecord/'+id,
    method: 'get',
	params:query
  })
}
//快速搜索列表
export function fastSearchList() {
  return request({
    url: '/customer/fastSearchList',
    method: 'get',
  })
}
//快速搜索列表置顶
export function fastTopUp(id) {
  return request({
    url: '/customer/fastTopUp/'+id,
    method: 'put',
  })
}
// 快速搜索列表取消置顶
export function cancelFastTopUp(id) {
  return request({
    url: '/customer/cancelFastTopUp/'+id,
    method: 'put',
  })
}
//快速搜索删除
export function fastSearchDel(id) {
  return request({
    url: '/customer/fastSearchDel/'+id,
    method: 'delete',
  })
}
//获取默认字段
export function defaultKey() {
  return request({
    url: '/system/dict/data/type/bs_customer_setfield',
    method: 'get',
  })
}
//设置筛选字段
export function fastSearchSave(data) {
  return request({
    url: '/customer/fastSearchSave',
    method: 'post',
	data: data
  })
}
//添加和修改字段
export function setFieldSave(data) {
  return request({
    url: '/customer/setFieldSave',
    method: 'post',
	data: data
  })
}
//获取我选择的字段
export function setFieldList() {
  return request({
    url: '/customer/setFieldList',
    method: 'get',
  })
}